﻿//==================================================================
// Copyright (C) 2011 深圳市中旭企业管理股份有限公司
// 文件名: V_CrmDeliverMajorStudent.cs
// 作 者：代码自动生成
// 日 期：2013-3-8 13:50:32
// 描 述：
// 版 本：1.00
// 修改历史纪录
// 版 本  修改时间      修改人            修改内容
// 1.00             
//==================================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel;
using System.Text;
using Csla;
using lite;
using Csla.Validation;
using Csla.Data;
using System.Data.SqlClient;
using ZX.DAL;
using OpenExpressApp.ORM;

namespace ZX.CRM.Library
{
	/// <summary>
    /// 
    /// </summary>
	[Serializable]
    [Table(Name="V_CrmDeliverMajorStudent")]
    [ZX.DBModule.Table("V_CrmDeliverMajorStudent","ID")]
	public class V_CrmDeliverMajorStudent: ZX.DBModule.BaseEntity
	{
        #region Business Methods 业务方法
        /// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > IDProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("ID"));
        [DataObjectField(true, true)]
        [Column, PK]
        public Guid ID
        {
            get { return GetProperty(IDProperty); }
            set { SetProperty(IDProperty, value); }
        }
        
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > CodeProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("Code"));
        [Column]
        public string Code
        {
            get { return GetProperty(CodeProperty); }
            set { SetProperty(CodeProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > OrderProductIDProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("OrderProductID"));
        [Column]
        public Guid OrderProductID
        {
            get { return GetProperty(OrderProductIDProperty); }
            set { SetProperty(OrderProductIDProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > ProductLayoutIDProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("ProductLayoutID"));
        [Column]
        public Guid ProductLayoutID
        {
            get { return GetProperty(ProductLayoutIDProperty); }
            set { SetProperty(ProductLayoutIDProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > NegotiateTeachProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("NegotiateTeach"));
        [Column]
        public Guid NegotiateTeach
        {
            get { return GetProperty(NegotiateTeachProperty); }
            set { SetProperty(NegotiateTeachProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > ClassServerProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("ClassServer"));
        [Column]
        public Guid ClassServer
        {
            get { return GetProperty(ClassServerProperty); }
            set { SetProperty(ClassServerProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > ClassFrontServerProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("ClassFrontServer"));
        [Column]
        public Guid ClassFrontServer
        {
            get { return GetProperty(ClassFrontServerProperty); }
            set { SetProperty(ClassFrontServerProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > DliverStateProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("DliverState"));
        [Column]
        public Guid DliverState
        {
            get { return GetProperty(DliverStateProperty); }
            set { SetProperty(DliverStateProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > IsSureProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("IsSure"));
        [Column]
        public string IsSure
        {
            get { return GetProperty(IsSureProperty); }
            set { SetProperty(IsSureProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > SureUserProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("SureUser"));
        [Column]
        public Guid SureUser
        {
            get { return GetProperty(SureUserProperty); }
            set { SetProperty(SureUserProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< DateTime > SureTimeProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< DateTime >("SureTime"));
        [Column]
        public DateTime SureTime
        {
            get { return GetProperty(SureTimeProperty); }
            set { SetProperty(SureTimeProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > AddUserProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("AddUser"));
        [Column]
        public Guid AddUser
        {
            get { return GetProperty(AddUserProperty); }
            set { SetProperty(AddUserProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< DateTime > AddTimeProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< DateTime >("AddTime"));
        [Column]
        public DateTime AddTime
        {
            get { return GetProperty(AddTimeProperty); }
            set { SetProperty(AddTimeProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > MajorStudentIdProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("MajorStudentId"));
        [Column]
        public Guid MajorStudentId
        {
            get { return GetProperty(MajorStudentIdProperty); }
            set { SetProperty(MajorStudentIdProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > ClassNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("ClassName"));
        [Column]
        public string ClassName
        {
            get { return GetProperty(ClassNameProperty); }
            set { SetProperty(ClassNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > PrintClassNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("PrintClassName"));
        [Column]
        public string PrintClassName
        {
            get { return GetProperty(PrintClassNameProperty); }
            set { SetProperty(PrintClassNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > IDCardProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("IDCard"));
        [Column]
        public string IDCard
        {
            get { return GetProperty(IDCardProperty); }
            set { SetProperty(IDCardProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > SexProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("Sex"));
        [Column]
        public string Sex
        {
            get { return GetProperty(SexProperty); }
            set { SetProperty(SexProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > PostProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("Post"));
        [Column]
        public string Post
        {
            get { return GetProperty(PostProperty); }
            set { SetProperty(PostProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > IsTrainProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("IsTrain"));
        [Column]
        public string IsTrain
        {
            get { return GetProperty(IsTrainProperty); }
            set { SetProperty(IsTrainProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > IsDecisionProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("IsDecision"));
        [Column]
        public string IsDecision
        {
            get { return GetProperty(IsDecisionProperty); }
            set { SetProperty(IsDecisionProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > HouseTypeProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("HouseType"));
        [Column]
        public Guid HouseType
        {
            get { return GetProperty(HouseTypeProperty); }
            set { SetProperty(HouseTypeProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > TrafficTypeProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("TrafficType"));
        [Column]
        public Guid TrafficType
        {
            get { return GetProperty(TrafficTypeProperty); }
            set { SetProperty(TrafficTypeProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > FlightNumProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("FlightNum"));
        [Column]
        public string FlightNum
        {
            get { return GetProperty(FlightNumProperty); }
            set { SetProperty(FlightNumProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< DateTime > ArriveatTimeProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< DateTime >("ArriveatTime"));
        [Column]
        public DateTime ArriveatTime
        {
            get { return GetProperty(ArriveatTimeProperty); }
            set { SetProperty(ArriveatTimeProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > GroupNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("GroupName"));
        [Column]
        public string GroupName
        {
            get { return GetProperty(GroupNameProperty); }
            set { SetProperty(GroupNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > ColonelProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("Colonel"));
        [Column]
        public Guid Colonel
        {
            get { return GetProperty(ColonelProperty); }
            set { SetProperty(ColonelProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > AssistanceProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("Assistance"));
        [Column]
        public Guid Assistance
        {
            get { return GetProperty(AssistanceProperty); }
            set { SetProperty(AssistanceProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > IsSignInProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("IsSignIn"));
        [Column]
        public string IsSignIn
        {
            get { return GetProperty(IsSignInProperty); }
            set { SetProperty(IsSignInProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< DateTime > SignInProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< DateTime >("SignIn"));
        [Column]
        public DateTime SignIn
        {
            get { return GetProperty(SignInProperty); }
            set { SetProperty(SignInProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > ActualHouseTypeProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("ActualHouseType"));
        [Column]
        public Guid ActualHouseType
        {
            get { return GetProperty(ActualHouseTypeProperty); }
            set { SetProperty(ActualHouseTypeProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > ExplainProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("Explain"));
        [Column]
        public string Explain
        {
            get { return GetProperty(ExplainProperty); }
            set { SetProperty(ExplainProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > Exp1Property = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("Exp1"));
        [Column]
        public string Exp1
        {
            get { return GetProperty(Exp1Property); }
            set { SetProperty(Exp1Property, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > Exp2Property = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("Exp2"));
        [Column]
        public string Exp2
        {
            get { return GetProperty(Exp2Property); }
            set { SetProperty(Exp2Property, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > exp3Property = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("exp3"));
        [Column]
        public string exp3
        {
            get { return GetProperty(exp3Property); }
            set { SetProperty(exp3Property, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > Exp4Property = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("Exp4"));
        [Column]
        public string Exp4
        {
            get { return GetProperty(Exp4Property); }
            set { SetProperty(Exp4Property, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > Exp5Property = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("Exp5"));
        [Column]
        public string Exp5
        {
            get { return GetProperty(Exp5Property); }
            set { SetProperty(Exp5Property, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > HourseTypeNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("HourseTypeName"));
        [Column]
        public string HourseTypeName
        {
            get { return GetProperty(HourseTypeNameProperty); }
            set { SetProperty(HourseTypeNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > HourseTypeValueProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("HourseTypeValue"));
        [Column]
        public string HourseTypeValue
        {
            get { return GetProperty(HourseTypeValueProperty); }
            set { SetProperty(HourseTypeValueProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > TrafficTypeNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("TrafficTypeName"));
        [Column]
        public string TrafficTypeName
        {
            get { return GetProperty(TrafficTypeNameProperty); }
            set { SetProperty(TrafficTypeNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > TrafficTypeValueProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("TrafficTypeValue"));
        [Column]
        public string TrafficTypeValue
        {
            get { return GetProperty(TrafficTypeValueProperty); }
            set { SetProperty(TrafficTypeValueProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > CustomerMgrNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("CustomerMgrName"));
        [Column]
        public string CustomerMgrName
        {
            get { return GetProperty(CustomerMgrNameProperty); }
            set { SetProperty(CustomerMgrNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > OrderofDeptNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("OrderofDeptName"));
        [Column]
        public string OrderofDeptName
        {
            get { return GetProperty(OrderofDeptNameProperty); }
            set { SetProperty(OrderofDeptNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > CustomerNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("CustomerName"));
        [Column]
        public string CustomerName
        {
            get { return GetProperty(CustomerNameProperty); }
            set { SetProperty(CustomerNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > SaleadviserNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("SaleadviserName"));
        [Column]
        public string SaleadviserName
        {
            get { return GetProperty(SaleadviserNameProperty); }
            set { SetProperty(SaleadviserNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > AddUserNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("AddUserName"));
        [Column]
        public string AddUserName
        {
            get { return GetProperty(AddUserNameProperty); }
            set { SetProperty(AddUserNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > LectorNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("LectorName"));
        [Column]
        public string LectorName
        {
            get { return GetProperty(LectorNameProperty); }
            set { SetProperty(LectorNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > NegotiateTeachNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("NegotiateTeachName"));
        [Column]
        public string NegotiateTeachName
        {
            get { return GetProperty(NegotiateTeachNameProperty); }
            set { SetProperty(NegotiateTeachNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > ClassServerNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("ClassServerName"));
        [Column]
        public string ClassServerName
        {
            get { return GetProperty(ClassServerNameProperty); }
            set { SetProperty(ClassServerNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > ClassFrontServerNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("ClassFrontServerName"));
        [Column]
        public string ClassFrontServerName
        {
            get { return GetProperty(ClassFrontServerNameProperty); }
            set { SetProperty(ClassFrontServerNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > SureNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("SureName"));
        [Column]
        public string SureName
        {
            get { return GetProperty(SureNameProperty); }
            set { SetProperty(SureNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > CreateUserNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("CreateUserName"));
        [Column]
        public string CreateUserName
        {
            get { return GetProperty(CreateUserNameProperty); }
            set { SetProperty(CreateUserNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > AssistanceNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("AssistanceName"));
        [Column]
        public string AssistanceName
        {
            get { return GetProperty(AssistanceNameProperty); }
            set { SetProperty(AssistanceNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > ColonelNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("ColonelName"));
        [Column]
        public string ColonelName
        {
            get { return GetProperty(ColonelNameProperty); }
            set { SetProperty(ColonelNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > CustomerCodeProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("CustomerCode"));
        [Column]
        public string CustomerCode
        {
            get { return GetProperty(CustomerCodeProperty); }
            set { SetProperty(CustomerCodeProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< int > GroupNumberProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< int >("GroupNumber"));
        [Column]
        public int GroupNumber
        {
            get { return GetProperty(GroupNumberProperty); }
            set { SetProperty(GroupNumberProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > CustomerIdProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("CustomerId"));
        [Column]
        public Guid CustomerId
        {
            get { return GetProperty(CustomerIdProperty); }
            set { SetProperty(CustomerIdProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > ActualHourseTypeNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("ActualHourseTypeName"));
        [Column]
        public string ActualHourseTypeName
        {
            get { return GetProperty(ActualHourseTypeNameProperty); }
            set { SetProperty(ActualHourseTypeNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > CourseLayoutNameProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("CourseLayoutName"));
        [Column]
        public string CourseLayoutName
        {
            get { return GetProperty(CourseLayoutNameProperty); }
            set { SetProperty(CourseLayoutNameProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > ProductIDProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("ProductID"));
        [Column]
        public Guid ProductID
        {
            get { return GetProperty(ProductIDProperty); }
            set { SetProperty(ProductIDProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< Guid > CustomeerMgrProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< Guid >("CustomeerMgr"));
        [Column]
        public Guid CustomeerMgr
        {
            get { return GetProperty(CustomeerMgrProperty); }
            set { SetProperty(CustomeerMgrProperty, value); }
        }
		/// <summary>
        /// 
        /// </summary>
        private static PropertyInfo< string > MobileProperty = RegisterProperty(typeof(V_CrmDeliverMajorStudent),new PropertyInfo< string >("Mobile"));
        [Column]
        public string Mobile
        {
            get { return GetProperty(MobileProperty); }
            set { SetProperty(MobileProperty, value); }
        }
        #endregion
        
        #region Validation Rules 验证规则
        //将验证规则与业务对象的属性联系在一起
        protected override void AddBusinessRules()
        {
            //AddRule的第一个参数是委托变量，也就是说是方法的变量
            ValidationRules.AddRule(CommonRules.StringRequired, "Code");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Code", 15));
            ValidationRules.AddRule(CommonRules.StringRequired, "IsSure");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("IsSure", 1));
            ValidationRules.AddRule(CommonRules.StringRequired, "ClassName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("ClassName", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "PrintClassName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("PrintClassName", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "IDCard");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("IDCard", 20));
            ValidationRules.AddRule(CommonRules.StringRequired, "Sex");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Sex", 5));
            ValidationRules.AddRule(CommonRules.StringRequired, "Post");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Post", 10));
            ValidationRules.AddRule(CommonRules.StringRequired, "IsTrain");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("IsTrain", 1));
            ValidationRules.AddRule(CommonRules.StringRequired, "IsDecision");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("IsDecision", 1));
            ValidationRules.AddRule(CommonRules.StringRequired, "FlightNum");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("FlightNum", 20));
            ValidationRules.AddRule(CommonRules.StringRequired, "GroupName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("GroupName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "IsSignIn");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("IsSignIn", 1));
            ValidationRules.AddRule(CommonRules.StringRequired, "Explain");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Explain", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "Exp1");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Exp1", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "Exp2");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Exp2", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "exp3");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("exp3", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "Exp4");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Exp4", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "Exp5");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Exp5", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "HourseTypeName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("HourseTypeName", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "HourseTypeValue");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("HourseTypeValue", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "TrafficTypeName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("TrafficTypeName", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "TrafficTypeValue");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("TrafficTypeValue", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "CustomerMgrName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CustomerMgrName", 20));
            ValidationRules.AddRule(CommonRules.StringRequired, "OrderofDeptName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("OrderofDeptName", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "CustomerName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CustomerName", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "SaleadviserName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("SaleadviserName", 20));
            ValidationRules.AddRule(CommonRules.StringRequired, "AddUserName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("AddUserName", 20));
            ValidationRules.AddRule(CommonRules.StringRequired, "LectorName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("LectorName", 20));
            ValidationRules.AddRule(CommonRules.StringRequired, "NegotiateTeachName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("NegotiateTeachName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "ClassServerName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("ClassServerName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "ClassFrontServerName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("ClassFrontServerName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "SureName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("SureName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "CreateUserName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CreateUserName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "AssistanceName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("AssistanceName", 30));
            ValidationRules.AddRule(CommonRules.StringRequired, "ColonelName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("ColonelName", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "CustomerCode");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CustomerCode", 15));
            ValidationRules.AddRule(CommonRules.StringRequired, "ActualHourseTypeName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("ActualHourseTypeName", 100));
            ValidationRules.AddRule(CommonRules.StringRequired, "CourseLayoutName");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("CourseLayoutName", 50));
            ValidationRules.AddRule(CommonRules.StringRequired, "Mobile");
            ValidationRules.AddRule(CommonRules.StringMaxLength, new Csla.Validation.CommonRules.MaxLengthRuleArgs("Mobile", 16));
            //base.AddBusinessRules();
        }
        #endregion
        
        #region Factory Methods 工厂方法

        public V_CrmDeliverMajorStudent(){}

        public static V_CrmDeliverMajorStudent New()
        {
            return DataPortal.Create< V_CrmDeliverMajorStudent>();
        }
        public static V_CrmDeliverMajorStudent Get(Guid ID)
        {
            return DataPortal.Fetch< V_CrmDeliverMajorStudent>(new SingleLazyCriteria< V_CrmDeliverMajorStudent, Guid>(ID, false));
        }
        public static void Delete(Guid ID )
        {
            DataPortal.Delete(ID);
        }
        
        #endregion
        
        #region Data Access 数据访问
        //由于DataPortal_create中没有对数据库的访问，所有标记了Runlocal特性，使得该方法只需在本地运行即可
        //如果代码中有访问数据库的方法，那么就不要用这个特性，使数据门户可以根据情况将此方法的运行选择在应用服务器还是本地
        [RunLocal()]
        protected override void DataPortal_Create()
        {
            //在此调用CheckRules对所有的属性进行验证规则的检查，这样检查只运行一次。
            ValidationRules.CheckRules();
        }


        //可以看到此方法没有标记任何特性
        //此方法要访问数据库所以不能标记本地，由于她没有任何数据库更新操作所以也无需事务性的保护
        //此方法调用结束后会隐含的调用MarkOld（）方法
        private void DataPortal_Fetch(Guid ID)
        {
            //通过连接字符串建立SQL连接对象，Using符号代表，范围释放的意思，SqlConnection对象会在此范围后被释放掉
             using (var ctx = ConnectionManager<SqlConnection>.GetManager(ConnectionStringNames))
            {
                IDb db = DbFactory.Instance.GetDb(ctx.Connection);
                IQuery q = db.Query();
                q.Constrain("ID").Equal(ID);
                
                var data = db.Select< V_CrmDeliverMajorStudent>(q)[0];
                LoadProperty(IDProperty, data.ID);
                LoadProperty(CodeProperty, data.Code);
                LoadProperty(OrderProductIDProperty, data.OrderProductID);
                LoadProperty(ProductLayoutIDProperty, data.ProductLayoutID);
                LoadProperty(NegotiateTeachProperty, data.NegotiateTeach);
                LoadProperty(ClassServerProperty, data.ClassServer);
                LoadProperty(ClassFrontServerProperty, data.ClassFrontServer);
                LoadProperty(DliverStateProperty, data.DliverState);
                LoadProperty(IsSureProperty, data.IsSure);
                LoadProperty(SureUserProperty, data.SureUser);
                LoadProperty(SureTimeProperty, data.SureTime);
                LoadProperty(AddUserProperty, data.AddUser);
                LoadProperty(AddTimeProperty, data.AddTime);
                LoadProperty(MajorStudentIdProperty, data.MajorStudentId);
                LoadProperty(ClassNameProperty, data.ClassName);
                LoadProperty(PrintClassNameProperty, data.PrintClassName);
                LoadProperty(IDCardProperty, data.IDCard);
                LoadProperty(SexProperty, data.Sex);
                LoadProperty(PostProperty, data.Post);
                LoadProperty(IsTrainProperty, data.IsTrain);
                LoadProperty(IsDecisionProperty, data.IsDecision);
                LoadProperty(HouseTypeProperty, data.HouseType);
                LoadProperty(TrafficTypeProperty, data.TrafficType);
                LoadProperty(FlightNumProperty, data.FlightNum);
                LoadProperty(ArriveatTimeProperty, data.ArriveatTime);
                LoadProperty(GroupNameProperty, data.GroupName);
                LoadProperty(ColonelProperty, data.Colonel);
                LoadProperty(AssistanceProperty, data.Assistance);
                LoadProperty(IsSignInProperty, data.IsSignIn);
                LoadProperty(SignInProperty, data.SignIn);
                LoadProperty(ActualHouseTypeProperty, data.ActualHouseType);
                LoadProperty(ExplainProperty, data.Explain);
                LoadProperty(Exp1Property, data.Exp1);
                LoadProperty(Exp2Property, data.Exp2);
                LoadProperty(exp3Property, data.exp3);
                LoadProperty(Exp4Property, data.Exp4);
                LoadProperty(Exp5Property, data.Exp5);
                LoadProperty(HourseTypeNameProperty, data.HourseTypeName);
                LoadProperty(HourseTypeValueProperty, data.HourseTypeValue);
                LoadProperty(TrafficTypeNameProperty, data.TrafficTypeName);
                LoadProperty(TrafficTypeValueProperty, data.TrafficTypeValue);
                LoadProperty(CustomerMgrNameProperty, data.CustomerMgrName);
                LoadProperty(OrderofDeptNameProperty, data.OrderofDeptName);
                LoadProperty(CustomerNameProperty, data.CustomerName);
                LoadProperty(SaleadviserNameProperty, data.SaleadviserName);
                LoadProperty(AddUserNameProperty, data.AddUserName);
                LoadProperty(LectorNameProperty, data.LectorName);
                LoadProperty(NegotiateTeachNameProperty, data.NegotiateTeachName);
                LoadProperty(ClassServerNameProperty, data.ClassServerName);
                LoadProperty(ClassFrontServerNameProperty, data.ClassFrontServerName);
                LoadProperty(SureNameProperty, data.SureName);
                LoadProperty(CreateUserNameProperty, data.CreateUserName);
                LoadProperty(AssistanceNameProperty, data.AssistanceName);
                LoadProperty(ColonelNameProperty, data.ColonelName);
                LoadProperty(CustomerCodeProperty, data.CustomerCode);
                LoadProperty(GroupNumberProperty, data.GroupNumber);
                LoadProperty(CustomerIdProperty, data.CustomerId);
                LoadProperty(ActualHourseTypeNameProperty, data.ActualHourseTypeName);
                LoadProperty(CourseLayoutNameProperty, data.CourseLayoutName);
                LoadProperty(ProductIDProperty, data.ProductID);
                LoadProperty(CustomeerMgrProperty, data.CustomeerMgr);
                LoadProperty(MobileProperty, data.Mobile);
            }
        }

        [Transactional(TransactionalTypes.TransactionScope)]
        protected override void DataPortal_DeleteSelf()
        {
            //依然是调用下面的方法删除的，只是他此时可以获得自己的Id
            DataPortal_Delete(IDProperty);
        }
        #endregion
	}
}

